﻿$(document).ready(function () {
    $("#tabs").tabs();

    $(document).on("keyup", "input[id^=textsearch]", function () {
        searchText($(this));
    });
});

function searchText(obj) {
    var tableID = "";
    try {
        if (obj[0].id.indexOf("menu") > -1)
            tableID = "tb_Menu";
        if (obj[0].id.indexOf("object") > -1)
            tableID = "tb_object";
        if (obj[0].id.indexOf("report") > -1)
            tableID = "tb_report";
        if (obj[0].id.indexOf("qlinks") > -1)
            tableID = "tb_quick_links";

        $("#ctl00_ContentPlaceHolder3_" + tableID + " tr").each(function () {
            if (this.rowIndex != 0) {
                if ($('td:first-child', this).text().toLowerCase().indexOf(obj.val().toLowerCase()) > -1)
                    $(this).slideDown("fast");
                else
                    $(this).slideUp("fast");
            }
        });
    }
    catch (e) { }
}